from django.shortcuts import render
from django.http import HttpResponse
import json
from .models import MfProduct


# Create your views here.
def handleList(request):
    return render(request, 'product.html')
    # myData = MfProduct.objects.all().values()
    # myList = list(myData)
    # print(myList, type(myList))
    # result = {"code": 1, "msg": myList}
    # return HttpResponse(json.dumps(result))

def handleDetail(request):
    return render(request, 'product_details.html')
    # product/detail?id=1
    # myId = request.GET['id']
    # myData = MfProduct.objects.filter(id=myId).values()
    # myList = list(myData)
    # print(myList, type(myList))
    # result = {"code": 1, "msg": myList[0]}
    # return HttpResponse(json.dumps(result))
